package com.tsll.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 操作日志记录
 * @TableName sys_oper_log
 */
public class SysOperLog implements Serializable {
    /**
     * 日志主键
     */
    private Long operid;

    /**
     * 业务类型（0其它 1新增 2修改 3删除）
     */
    private String businesstype;

    /**
     * 方法名称
     */
    private String method;

    /**
     * 请求方式
     */
    private String requestmethod;

    /**
     * 操作人员
     */
    private String opername;

    /**
     * 请求URL
     */
    private String operurl;

    /**
     * 主机地址
     */
    private String operip;

    /**
     * 请求参数
     */
    private String operparam;

    /**
     * 返回参数
     */
    private String jsonresult;

    /**
     * 操作状态（0正常 1异常）
     */
    private Integer status;

    /**
     * 操作时间
     */
    @DateTimeFormat(pattern= "yyyy-MM-dd")
    @JsonFormat(pattern= "yyyy-MM-dd",timezone = "GMT+8")
    private Date opertime;

    private static final long serialVersionUID = 1L;

    /**
     * 日志主键
     */
    public Long getOperid() {
        return operid;
    }

    /**
     * 日志主键
     */
    public void setOperid(Long operid) {
        this.operid = operid;
    }

    /**
     * 业务类型（0其它 1新增 2修改 3删除）
     */
    public String getBusinesstype() {
        return businesstype;
    }

    /**
     * 业务类型（0其它 1新增 2修改 3删除）
     */
    public void setBusinesstype(String businesstype) {
        this.businesstype = businesstype;
    }

    /**
     * 方法名称
     */
    public String getMethod() {
        return method;
    }

    /**
     * 方法名称
     */
    public void setMethod(String method) {
        this.method = method;
    }

    /**
     * 请求方式
     */
    public String getRequestmethod() {
        return requestmethod;
    }

    /**
     * 请求方式
     */
    public void setRequestmethod(String requestmethod) {
        this.requestmethod = requestmethod;
    }

    /**
     * 操作人员
     */
    public String getOpername() {
        return opername;
    }

    /**
     * 操作人员
     */
    public void setOpername(String opername) {
        this.opername = opername;
    }

    /**
     * 请求URL
     */
    public String getOperurl() {
        return operurl;
    }

    /**
     * 请求URL
     */
    public void setOperurl(String operurl) {
        this.operurl = operurl;
    }

    /**
     * 主机地址
     */
    public String getOperip() {
        return operip;
    }

    /**
     * 主机地址
     */
    public void setOperip(String operip) {
        this.operip = operip;
    }

    /**
     * 请求参数
     */
    public String getOperparam() {
        return operparam;
    }

    /**
     * 请求参数
     */
    public void setOperparam(String operparam) {
        this.operparam = operparam;
    }

    /**
     * 返回参数
     */
    public String getJsonresult() {
        return jsonresult;
    }

    /**
     * 返回参数
     */
    public void setJsonresult(String jsonresult) {
        this.jsonresult = jsonresult;
    }

    /**
     * 操作状态（0正常 1异常）
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 操作状态（0正常 1异常）
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 操作时间
     */
    public Date getOpertime() {
        return opertime;
    }

    /**
     * 操作时间
     */
    public void setOpertime(Date opertime) {
        this.opertime = opertime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysOperLog other = (SysOperLog) that;
        return (this.getOperid() == null ? other.getOperid() == null : this.getOperid().equals(other.getOperid()))
            && (this.getBusinesstype() == null ? other.getBusinesstype() == null : this.getBusinesstype().equals(other.getBusinesstype()))
            && (this.getMethod() == null ? other.getMethod() == null : this.getMethod().equals(other.getMethod()))
            && (this.getRequestmethod() == null ? other.getRequestmethod() == null : this.getRequestmethod().equals(other.getRequestmethod()))
            && (this.getOpername() == null ? other.getOpername() == null : this.getOpername().equals(other.getOpername()))
            && (this.getOperurl() == null ? other.getOperurl() == null : this.getOperurl().equals(other.getOperurl()))
            && (this.getOperip() == null ? other.getOperip() == null : this.getOperip().equals(other.getOperip()))
            && (this.getOperparam() == null ? other.getOperparam() == null : this.getOperparam().equals(other.getOperparam()))
            && (this.getJsonresult() == null ? other.getJsonresult() == null : this.getJsonresult().equals(other.getJsonresult()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getOpertime() == null ? other.getOpertime() == null : this.getOpertime().equals(other.getOpertime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOperid() == null) ? 0 : getOperid().hashCode());
        result = prime * result + ((getBusinesstype() == null) ? 0 : getBusinesstype().hashCode());
        result = prime * result + ((getMethod() == null) ? 0 : getMethod().hashCode());
        result = prime * result + ((getRequestmethod() == null) ? 0 : getRequestmethod().hashCode());
        result = prime * result + ((getOpername() == null) ? 0 : getOpername().hashCode());
        result = prime * result + ((getOperurl() == null) ? 0 : getOperurl().hashCode());
        result = prime * result + ((getOperip() == null) ? 0 : getOperip().hashCode());
        result = prime * result + ((getOperparam() == null) ? 0 : getOperparam().hashCode());
        result = prime * result + ((getJsonresult() == null) ? 0 : getJsonresult().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getOpertime() == null) ? 0 : getOpertime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", operid=").append(operid);
        sb.append(", businesstype=").append(businesstype);
        sb.append(", method=").append(method);
        sb.append(", requestmethod=").append(requestmethod);
        sb.append(", opername=").append(opername);
        sb.append(", operurl=").append(operurl);
        sb.append(", operip=").append(operip);
        sb.append(", operparam=").append(operparam);
        sb.append(", jsonresult=").append(jsonresult);
        sb.append(", status=").append(status);
        sb.append(", opertime=").append(opertime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}